<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body {
            display: flex;
            align-items: center;
            justify-content: center;
            height: 100vh;
            margin: 0;
            padding: 0;
        }

        div {
            width: 12vw;
            height: 8vh;
            border: 4px solid skyblue;
            text-align: center;
            line-height: 8vh;
            font-weight: bold;
            font-size: 1.5vw;
            background-color: transparent;
            position: relative;
            overflow: hidden;
            color: darkblue;
        }

        div::before{
            content: '';
            display: block;
            width: 0%;
            height: 100%;
            background-color: skyblue;
            position: absolute;
            left: -30%;
            z-index: -1;
            transform: skewX(45deg);
            transition: all .9s;
        }
        div:hover::before{
            width: 200%;
        }
    </style>
</head>

<body>
    <div>这是一个按钮</div>
</body>

</html>